#ifndef ACOFSH_INCLUDED
#define ACOFSH_INCLUDED

#include "base.h"
#include <math.h>

#define MAGIC_NUMBER 6869

/* formigueiro */
typedef struct 
{
	char *sol;
	double solF;
} Ant;


/* estrutura que contem as informacoes 
   relacionadas ao experimento */
typedef struct
{
	char *elite;
	int nElite;
	char *bestSol;
	double bestSolF;
	Ant *anthill;
	int nAnts;
	double **trail;
	Base *base;
	int *fInfoIndx;
	int b_local;
	unsigned long long int max;
} Experiment;

Experiment *newExperiment(Base*, int, int, int, unsigned long long int, double);
void resetAnt(Ant*, int);
void optmize(Experiment*);
void elite(Experiment*, int*);
void rankAnts(Experiment*, int*);
void saveBestSol(Experiment*, Ant*);
void inherit(char*, char*, int, double);
void updateTrail(Experiment*, int*);
double hBuild(int, int, double**, double*, char*, double, double);
void trailUp(int, double**, int, char*, double);
void trailEvp(double**, int, double);
void buildway(Ant*, double**, Base*, int*, double, double, double);
double **calcClassCenters(Base*, int, char*);
double euclideanDist(double*, double*, int);
double interClassDist(Base*, int, char*); 
double intraClassDist(Base*, int, char*);
double h(Base*, int, char*);
void indexFInfo(int*, double*, int);
int localSearch(Base*, Ant*, int, int);

#endif //acofsh_included
